import {
  Component,
  Host,
  Input,
  Optional,
} from '@angular/core';
import { Flower } from '../flower';

@Component({
  selector: 'app-c',
  standalone: true,
  template: `
    C (<code>&#64;Host</code>) - [{{ prefix }}]:
    {{ flower?.name }}
  `,
  styles: `:host { display: block; }`,
})
export class CComponent {
  @Input({ required: true }) prefix!: string;

  constructor(
    @Host()
    @Optional()
    public flower: Flower | null
  ) {}
}
